package com.chinairi.mall.service.impl;

import com.chinairi.mall.dao.SecondCockpitManageMapper;
import com.chinairi.mall.param.SecondCockpitManageQueryModel;
import com.chinairi.mall.service.ISecondCockpitManageService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 领导驾驶舱二级业务逻辑接口实现类
 * @author 李昌赐
 * @since 2020−12-02
 */
@Service
public class SecondCockpitManageServiceImpl implements ISecondCockpitManageService {

    @Autowired
    private SecondCockpitManageMapper secondCockpitManageMapper ;

    @Override
    public List<Map<String, Object>> listProject(SecondCockpitManageQueryModel secondCockpitManageQueryModel) {
        return secondCockpitManageMapper.listProject(secondCockpitManageQueryModel);
    }

    @Override
    public List<Map<String, Object>> listProjectPlanReq(SecondCockpitManageQueryModel secondCockpitManageQueryModel) {
        if (StringUtils.isEmpty(secondCockpitManageQueryModel.getpId())){
            return new ArrayList<>();
        }
        return secondCockpitManageMapper.listProjectPlanReq(secondCockpitManageQueryModel);
    }

    @Override
    public List<Map<String, Object>> listGoodsOrder(SecondCockpitManageQueryModel secondCockpitManageQueryModel) {
        if (StringUtils.isEmpty(secondCockpitManageQueryModel.getPlanReqId())){
            return new ArrayList<>();
        }
        return secondCockpitManageMapper.listGoodsOrder(secondCockpitManageQueryModel);
    }

    @Override
    public List<Map<String, Object>> listServiceOrder(SecondCockpitManageQueryModel secondCockpitManageQueryModel) {
        if (StringUtils.isEmpty(secondCockpitManageQueryModel.getOrderId())){
            return new ArrayList<>();
        }
        return secondCockpitManageMapper.listServiceOrder(secondCockpitManageQueryModel);
    }
}
